package com.joshluisaac.generics;

public class GenericBox<T> {

	private T t;

	public T getT() {
		return t;
	}

	public void setT(T t) {
		this.t = t;
	}

	public static void main(String[] args) {
		// Like any other variable declaration, this code does not actually
		// create a new GenericBox object.
		// It simply declares that integerBox will hold a reference to a
		// "GenericBox of Integer", which is how GenericBox<Integer> is read.
		
		@SuppressWarnings("unused")
		GenericBox<Integer> integerBox = new GenericBox<Integer>();
		//shortened using diamond notation In Java SE 7 and later.
		//The compiler can infer or determine the type arguments from the context.
		@SuppressWarnings("unused")
		GenericBox<Integer> integerBoxShortened = new GenericBox<Integer>();
	}

}
